import {_decorator, Animation, AnimationClip, Component, SpriteFrame} from 'cc';
import {FSM_TYPE_ENUM, PARAMS_NAME_ENUM} from "../Enums";
import State from "./State";
import {StateMachine} from "./StateMachine";

const { ccclass, property } = _decorator;

export abstract class SubStateMachine {
    stateMachines: Map<string, State> = new Map();
    private _currentState: State = null;

    get currentState(){
        return this._currentState;
    }
    set currentState(newState) {
        this._currentState = newState;
        this._currentState.run();
    }

    constructor(public fsm: StateMachine) {
    }



    abstract run(): void

}

